<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Data.Word</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Unsigned integer types.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Word</span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Unsigned integral types</span></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier">Word</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Word.html#Word8"><span class="hs-identifier">Word8</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#Word16"><span class="hs-identifier">Word16</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier">Word32</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#Word64"><span class="hs-identifier">Word64</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><span class="hs-comment">-- * byte swapping</span></span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Word.html#byteSwap16"><span class="hs-identifier">byteSwap16</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#byteSwap32"><span class="hs-identifier">byteSwap32</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#byteSwap64"><span class="hs-identifier">byteSwap64</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><span class="hs-comment">-- * bit reversal</span></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Word.html#bitReverse8"><span class="hs-identifier">bitReverse8</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#bitReverse16"><span class="hs-identifier">bitReverse16</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#bitReverse32"><span class="hs-identifier">bitReverse32</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Word.html#bitReverse64"><span class="hs-identifier">bitReverse64</span></a></span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Notes</span></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><span class="hs-comment">-- $notes</span></span><span>
</span><span id="line-34"></span><span>        </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Word.html"><span class="hs-identifier">GHC.Word</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Read.html"><span class="hs-identifier">GHC.Read</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Need the `Read` instance for types defined in `GHC.Word`.</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-comment">{- $notes

* All arithmetic is performed modulo 2^n, where n is the number of
  bits in the type.  One non-obvious consequence of this is that 'Prelude.negate'
  should /not/ raise an error on negative arguments.

* For coercing between any two integer types, use
  'Prelude.fromIntegral', which is specialized for all the
  common cases so should be fast enough.  Coercing word types to and
  from integer types preserves representation, not sign.

* An unbounded size unsigned integer type is available with
  'Numeric.Natural.Natural'.

* The rules that hold for 'Prelude.Enum' instances over a bounded type
  such as 'Prelude.Int' (see the section of the Haskell report dealing
  with arithmetic sequences) also hold for the 'Prelude.Enum' instances
  over the various 'Word' types defined here.

* Right and left shifts by amounts greater than or equal to the width
  of the type result in a zero result.  This is contrary to the
  behaviour in C, which is undefined; a common interpretation is to
  truncate the shift count to the width of the type, for example @1 \&lt;\&lt;
  32 == 1@ in some C implementations.
-}</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span></pre></body></html>